Skip to content

Add selection and selectionHtml variables #495

Merged
kepano merged 4 commits intoobsidianmd:mainfrom
chasemccoy:patch-1
Aug 14, 2025
Merged

Add selection and selectionHtml variables #495
kepano merged 4 commits intoobsidianmd:mainfrom
chasemccoy:patch-1

Conversation

@chasemccoy
Copy link
Contributor

This PR adds new, separate variables containing only the content selected by the user (if any) in both markdown and HTML format. Currently, the content variable contains the selection if there is one, and otherwise the page contents or highlights.

I wanted my clipper template to capture selected text, but not default to clipping the entire page contents if there isn't a selection, so thought adding a separate variable for just the selection would be the way to go.

@chasemccoy chasemccoy marked this pull request as ready for review May 25, 2025 19:22
@neowukong
Copy link

I also hope to have the function of collecting system variables. You can refer to clipper master plugin.

@chasemccoy
Copy link
Contributor Author

@kepano is there someone I should tag to review a PR like this? Are contributions accepted?

@kepano
Copy link
Collaborator

kepano commented Jun 27, 2025

Currently I am busy working on Bases and going on vacation, so I will be slower than usual with PRs

@kepano kepano merged commit 6a61fbe into obsidianmd:main Aug 14, 2025
@neowukong
Copy link

This isn't the result I was hoping for. I want to be able to add the ability to capture recognizable elements of a page in the display page variable. Similar functionality can be found in OB's unofficial plug-in, Clipper Master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants